version 13.3R2.4;
dynamic-profiles {
    dyn-lns-profile {
        routing-instances {
            "$junos-routing-instance" {
                interface "$junos-interface-name";
                routing-options {
                    access-internal {
                        route $junos-subscriber-ip-address {
                            qualified-next-hop "$junos-interface-name";
                        }
                    }
                }
            }
        }
        interfaces {
            "$junos-interface-ifd-name" {
                unit "$junos-interface-unit" {
                    dial-options {
                        l2tp-interface-id l2tp-encapsulation;
                        dedicated;
                    }
                    family inet {
                        unnumbered-address "$junos-loopback-interface";
                    }
                }
            }
        }
    }
}
system {
    host-name mx104;
    root-authentication {
        encrypted-password "$1$pP2rb3nt$IlSQFrxYsDbyp10XgzEuW/"; ## SECRET-DATA
    }
    dynamic-profile-options {
        versioning;
    }
    login {
        user warrior {
            uid 2002;
            class super-user;
            authentication {
                encrypted-password "$1$i8a5NCp3$O6avDk29rTGcVohqVxGNj0"; ## SECRET-DATA
            }
        }
    }
    services {
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
            interactive-commands none;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
    processes {
        general-authentication-service {
            inactive: traceoptions {
                file gen-auth.log size 10m world-readable;
                flag all;
            }
        }
    }
}
chassis {
    fpc 1 {
        pic 0 {
            inline-services {
                bandwidth 1g;
            }
        }
    }
    network-services enhanced-ip;
}
services {
    l2tp {
        tunnel-group tunnel-group-1 {
            l2tp-access-profile l2tp-lns-profile;
            local-gateway {
                address 1.1.1.20;
            }
            service-interface si-1/0/0;
            dynamic-profile dyn-lns-profile;
        }
        inactive: traceoptions {
            file l2tp.log size 1m files 2 world-readable;
            level all;
            flag all;
        }
    }
}
access-profile Access-Profile-1;
interfaces {
    si-1/0/0 {
        description "-- Inline Service interface";
        hierarchical-scheduler maximum-hierarchy-levels 2;
        encapsulation generic-services;
        unit 0 {
            family inet;
        }
    }
    xe-2/0/0 {
        description "-- to EX4200";
        vlan-tagging;
        mtu 9192;
        gigether-options {
            no-flow-control;
        }
        unit 10 {
            description "-- management interface";
            vlan-id 10;
            family inet {
                address 10.10.10.1/24;
            }
        }
        unit 20 {
            description "-- service interface";
            vlan-id 20;
            family inet {
                address 20.20.20.1/24;
            }
        }
    }
    lo0 {
        description "-- loopback";
        unit 0 {
            family inet {
                address 1.1.1.20/32 {
                    primary;
                    preferred;
                }
            }
        }
    }
}
protocols {
    ppp-service {
        inactive: traceoptions {
            file ppp-service-trace.log size 10m world-readable;
            level all;
            flag all;
        }
    }
    ppp {
        inactive: traceoptions {
            file ppp-trace.log size 10m world-readable;
            level all;
            flag all;
        }
    }
}
access {
    group-profile ce-l2tp-group-profile {
        ppp {
            idle-timeout 3600;
            ppp-options {
                pap;
                chap;
            }
            keepalive 30;
        }
    }
    profile Access-Profile-1 {
        accounting-order radius;
        authentication-order radius;
        radius {
            authentication-server 10.10.10.64;
            accounting-server 10.10.10.64;
            options {
                nas-port-id-delimiter :;
                calling-station-id-delimiter :;
                calling-station-id-format {
                    nas-identifier;
                    interface-description;
                }
                accounting-session-id-format decimal;
                revert-interval 60;
                client-authentication-algorithm round-robin;
                client-accounting-algorithm direct;
                coa-dynamic-variable-validation;
            }
        }
        radius-server {
            10.10.10.64 {
                secret "$9$45Zi.Qz6AtOQFCu0Byr"; ## SECRET-DATA
                timeout 2;
                retry 3;
                max-outstanding-requests 200;
                source-address 10.10.10.1;
            }
        }
        accounting {
            order radius;
            immediate-update;
            coa-immediate-update;
            update-interval 10;
            statistics volume-time;
            send-acct-status-on-config-change;
        }
    }
    profile l2tp-lns-profile {
        client default {
            l2tp {
                maximum-sessions-per-tunnel 10;
                interface-id l2tp-encapsulation;
                lcp-renegotiation;
            }
            user-group-profile ce-l2tp-group-profile;
        }
    }
    address-assignment {
        pool ipv4-pool {
            family inet {
                network 192.168.0.0/24;
                range R1 {
                    low 192.168.0.101;
                    high 192.168.0.200;
                }
                xauth-attributes {
                    primary-dns 8.8.4.4/32;
                    secondary-dns 8.8.8.8/32;
                }
            }
        }
    }
    address-protection;
    report-interface-descriptions;
    radius-options {
        request-rate 500;
    }
}